public class Date {
    public int year;
    public int month;
    public int day;
    public void setDay(Date this, int y, int m, int d){
        /*this.year = year;
        this.month = month;
        this.day = day;*/
        this.year = y;
        this.month = m;
        this.day = d;
    }
    public void printDate(Date this){
        System.out.println(this.year + "-" + this.month + "-" + this.day);
    }

    public static void main(String[] args) {
        // 构造三个日期类型的对象 d1 d2 d3
        Date Date1 = new Date();
        Date Date2 = new Date();
        Date Date3 = new Date();

        // 对d1，d2，d3的日期设置
        Date1.setDay(2022, 8, 9);
        Date2.setDay(2023, 8, 9);
        Date3.setDay(2024, 8, 9);

        //打印日期的内容
        Date1.printDate();
        Date2.printDate();
        Date3.printDate();
    }
}
